Chinese Remainder Theorem

The Chinese remainder theorem is a statement about existence of solutions to a system of linear congruences. The problem originates from the book third century book Sun-tzu Suan-ching:

There are certain things whose number is unknown. If we count them by threes, we have two left over; by fives, we have three left over; and by sevens, two are left over. How many things are there?

The theorem is as follows:

Theorem

Given moduli \(m_1, m_2, \dots, m_n\) which are pairwise coprime integers, and \(a_1, a_2, \dots, a_n \in \mathbb{Z}\), there is a unique solution modulo \(m = m_1 m_2 \dots m_n\) to the system of equations:

\[ \begin{align*} x &\equiv a_1 \pmod{m_1} \\ x &\equiv a_2 \pmod{m_2} \\ \vdots& \\ x &\equiv a_n \pmod{m_n} \\ \end{align*}\]

Note that the proof given below is non-constructive. For actually finding such a solution, see the chinese remainder theorem algorithm.


The core part of the result that needs to be proven is the following isomorphism of additive groups:

\[ \mathbb{Z}/n\mathbb{Z} = \mathbb{Z}/s\mathbb{Z} \oplus \mathbb{Z}/t\mathbb{Z}\]

if \(\gcd(s, t) = 1\).

The full result then follows by induction.

This is equivalent to the decomposition of cyclic groups. It is proven here again to show the explicit isomorphism from \(\mathbb{Z}/n\mathbb{Z}\) to \(\mathbb{Z}/s\mathbb{Z} \oplus \mathbb{Z}/t\mathbb{Z}\), however the proof is otherwise identical, and is only repeated for convenience.

Note that this method does not give an explicit way to invert this isomorphism (that is what the chinese remainder theorem algorithm) is for.

Proof

Consider the homomorphism

\[ \phi : \mathbb{Z}/n\mathbb{Z} \to \mathbb{Z}/s\mathbb{Z} \oplus \mathbb{Z}/t\mathbb{Z}\]

given by

\[ \phi : a + n\mathbb{Z} \mapsto (a + s\mathbb{Z}, a + t\mathbb{Z}).\]

We will prove that this is an isomorphism simply by showing that the kernel is just the identity.

\[\begin{align*} \ker(\phi) &= \{a + n\mathbb{Z} \in \mathbb{Z}/n\mathbb{Z} : \phi(a + n\mathbb{Z}) = (0 + s\mathbb{Z}, 0 + t\mathbb{Z})\} \\ &= \{a + n\mathbb{Z} \in \mathbb{Z}/n\mathbb{Z} : (a + s\mathbb{Z}, a + t\mathbb{Z}) = (0 + s\mathbb{Z}, 0 + t\mathbb{Z})\} \\ &= \{a + n\mathbb{Z} \in \mathbb{Z}/n\mathbb{Z} : a + s\mathbb{Z} = 0 + s\mathbb{Z} \quad \text{and} \quad a + t\mathbb{Z} = 0 + t\mathbb{Z}\} \\ &= \{a + n\mathbb{Z} \in \mathbb{Z}/n\mathbb{Z} : a \in s\mathbb{Z} \quad \text{and} \quad a \in t\mathbb{Z}\} \\ &= \{a + n\mathbb{Z} \in \mathbb{Z}/n\mathbb{Z} : s \mid a \quad \text{and} \quad t \mid a\} \\ &= \{a + n\mathbb{Z} \in \mathbb{Z}/n\mathbb{Z} : st \mid a \} \tag{1} \\ &= \{a + n\mathbb{Z} \in \mathbb{Z}/n\mathbb{Z} : n \mid a \} \\ &= \{0 + n\mathbb{Z}\} \end{align*}\]

where step (1) is where the coprimality condition is used.